<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./font/iconfont.css">
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            background-color: #f3f5f7;
        }
        .da{
            width: 1350px;
            margin: auto;
        }
        img{
            width: 250px;
            height: 150px;
        }
        .s{
            width: 1350px;
            height: 50px;
            padding-top: 20px;
            padding-left: 10px;
        }
        li{
            width: 250px;
            height: 280px;
            float: left;
            background-color: #fff;
            margin: 10px;
            list-style: none;
            transition: all 1s;
        }
        li:hover{
            box-shadow: 0 15px 15px #999;
            transform: translate(0,-5px);
        }
        p{
            font-size: 13px;
           
        }
        .p{
            padding-left: 20px;
            padding-right: 20px;
            padding-top: 20px;
        }
        .gj{
            padding-left: 20px;
            color: orange;
        }
        .hz{
            padding-left: 10px;
            color:#aeaeae ;
        }
        .span{
            float: right;
            margin-right: 20px;
        }
    </style>
</head>
<body>
    <div class="da">
        <div class="s">
            精品推荐</span><span class="span">查看全部<span class="iconfont icon-chakanquanbu"></span></span>
        </div>
        <ul>
    
        </ul>
    </div>
</body>
</html>
<script>
    var arr=[
        {
            'src':'../甘雨.jpeg',
            'nr':'甘雨甘雨甘雨甘雨甘雨甘雨甘雨甘雨',
            'num':'1500'
        },
        {
            'src':'../胡桃.jpeg',
            'nr':'胡桃胡桃胡桃胡桃胡桃胡桃胡桃胡桃',
            'num':'2000'
        },
        {
            'src':'../神子.jpeg',
            'nr':'神子神子神子神子神子神子神子神子',
            'num':'2001'
        },
        {
            'src':'../甘雨.jpeg',
            'nr':'甘雨甘雨甘雨甘雨甘雨甘雨甘雨甘雨',
            'num':'1500'
        },
        {
            'src':'../胡桃.jpeg',
            'nr':'胡桃胡桃胡桃胡桃胡桃胡桃胡桃胡桃',
            'num':'2000'
        },
        {
            'src':'../神子.jpeg',
            'nr':'神子神子神子神子神子神子神子神子',
            'num':'2001'
        },
        {
            'src':'../甘雨.jpeg',
            'nr':'甘雨甘雨甘雨甘雨甘雨甘雨甘雨甘雨',
            'num':'1500'
        },
        {
            'src':'../胡桃.jpeg',
            'nr':'胡桃胡桃胡桃胡桃胡桃胡桃胡桃胡桃',
            'num':'2000'
        },
        {
            'src':'../神子.jpeg',
            'nr':'神子神子神子神子神子神子神子神子',
            'num':'2001'
        },
        {
            'src':'../胡桃.jpeg',
            'nr':'胡桃胡桃胡桃胡桃胡桃胡桃胡桃胡桃',
            'num':'2000'
        }
        
    ]
    var ul=document.querySelector("ul")
    for(i=0;i<arr.length;i++){
        // 1、创建
        var li=document.createElement("li")
        // 2、赋值
        li.innerHTML=`
                <img src="${arr[i].src}" alt=""><br>
                <p class="p">${arr[i].nr}</p><br>
                <p><span class="gj">高级</span><span class="hz">&emsp13;·&emsp13; ${arr[i].num}人在学习</span></p>
        `;
        // 3、添加
        ul.appendChild(li)
    }
</script>